package com.example.myproject.util;

import com.example.myproject.domain.User;

public class ThreadMemoryTest {
    public static void main(String[] args) {
        User user = new User();
        user.setAge(23);
        StringBuilder sb = new StringBuilder();
        for(int i =0;i<1024 * 1024;i++){
            sb.append("i");
        }
        user.setName(sb.toString());
        System.out.println("user:"+user);

        for(int i = 0;i<1000;i++){
            try {
                Thread.sleep(1 * 60 * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println("user::"+user);
                    for(;;);
                }
            }).start();
        }
        for(;;);
    }

}
